﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace NC.Web.Models
{
    public class ApiJsonResult
    {
        /// <summary>
        /// 操作成功，返回Ok
        /// </summary>
        /// <param name="status">Ok状态</param>
        public ApiJsonResult(ResultStatus status=ResultStatus.Ok)
        {
            this.status = status;
        }
        /// <summary>
        /// 操作失败，需要传递obj对象，返回BadRequest
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="status"></param>
        public ApiJsonResult(object obj, ResultStatus status = ResultStatus.BadRequest)
        {
            this.msg = obj;
            this.status = status;
        }
        public ResultStatus status { get; set; }
        public object msg { get; set; }
    }
}